import {
  BwComPropSetConstValueComEnum,
  BwCustomComPropDataTypeEnum,
  BwCustomComEmitParamDataTypeEnum,
  BwCustomComSlotParamDataTypeEnum,
  BwCustomComSoltTypeEnum,
} from '../../../render/models'
import type {
  BwCustomComEmitInfoModel,
  BwCustomComSlotInfoModel,
  BwCustomComPropInfoModel,
} from '../../../render/models'

/** 组件属性 */
const comAttrs: Array<BwCustomComPropInfoModel> = [
  {
    key: 'class',
    name: 'classNames',
    isRequire: false,
    defaultValue: undefined,
    dataType: [
      BwCustomComPropDataTypeEnum.string,
      BwCustomComPropDataTypeEnum.array,
    ],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.input,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'active-tab',
    name: '当前选中的标签(v-model)',
    isModel: true,
    isRequire: false,
    defaultValue: '0',
    dataType: [
      BwCustomComPropDataTypeEnum.number,
      BwCustomComPropDataTypeEnum.string,
    ],
    defaultValueDataType: BwCustomComPropDataTypeEnum.number,
    constValueSetCom: BwComPropSetConstValueComEnum.number,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'tabs',
    name: '设置标签页的标题',
    isRequire: false,
    defaultValue: `[]`,
    dataType: [BwCustomComPropDataTypeEnum.array],
    defaultValueDataType: BwCustomComPropDataTypeEnum.array,
    constValueSetCom: BwComPropSetConstValueComEnum.textarea,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'title',
    name: '顶部栏标题',
    isRequire: false,
    defaultValue: ``,
    dataType: [BwCustomComPropDataTypeEnum.string],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.input,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'show-toolbar',
    name: '是否显示顶部栏',
    isRequire: false,
    defaultValue: 'true',
    dataType: [BwCustomComPropDataTypeEnum.boolean],
    defaultValueDataType: BwCustomComPropDataTypeEnum.boolean,
    constValueSetCom: BwComPropSetConstValueComEnum.switch,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'next-step-text',
    name: '下一步按钮的文字',
    isRequire: false,
    defaultValue: '',
    dataType: [BwCustomComPropDataTypeEnum.string],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.input,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'confirm-button-text',
    name: '确认按钮文字',
    isRequire: false,
    defaultValue: '确认',
    dataType: [BwCustomComPropDataTypeEnum.string],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.input,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'cancel-button-text',
    name: '取消按钮文字',
    isRequire: false,
    defaultValue: '取消',
    dataType: [BwCustomComPropDataTypeEnum.string],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.input,
    constValueSetComProps: null,
    remark: '',
  },
]

/** 组件事件 */
const comEmits: Array<BwCustomComEmitInfoModel> = [
  {
    key: 'update:active-tab',
    name: '当前选中的标签变化时触发',
    isModel: true,
    params: [
      {
        paramKey: 'value',
        paramName: '标签下标',
        paramDataType: BwCustomComEmitParamDataTypeEnum.number,
        remark: '',
      },
    ],
  },
]

/** 组件插槽 */
const comSlots: Array<BwCustomComSlotInfoModel> = [
  {
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'toolbar',
      slotName: '自定义整个顶部栏的内容插槽',
    },
  },
  {
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'title',
      slotName: '自定义标题内容插槽',
    },
  },
  {
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'confirm',
      slotName: '自定义确认按钮内容插槽',
    },
  },
  {
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'cancel',
      slotName: '自定义取消按钮内容插槽',
    },
  },
  {
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'default',
      slotName: '默认插槽',
    },
  },
]

export const vantPickerGroupInfo = {
  comAttrs,
  comEmits,
  comSlots,
}
